<?php
namespace Home\Controller;
use Think\Controller;
Class CountryController extends Controller
{
    //个人店铺的商品特色
	public function index()
	{
        $token = "muchen";trim(I("post."));

        if (empty($token)) {

			$info['code'] = 2;

            $info['msg']  = "请登录";

            echo json_encode($info);die;        
		}

        $user_token['user_token'] = $token;

        $info = D("Index")->get_user_one_info($user_token);

        $condition["goods_user_id"] = $info['user_id'];

        $goods = D("Country")->get_goods_info($condition);

		$info['code'] = 0;

		$info['msg']  = "成功";

        $info['data']  = $goods;

        if (!$goods) {
			$info['code'] = 1;

            $info['msg']  = "暂无数据";
		}
        echo json_encode($info);die;   
	}

	//token过期自动跳转至登陆页面
	public function redirect_login()
	{
		$this->display("Index/login");
	}
}
?>


